# dict1 = {'name': '蔡徐坤', 'age': 28, 'like': 'rap'}
#
# # 1.字典增加键值对
# # 当字典没有对应键值对的时候，可以进行新增,默认加到末尾
# dict1['sex'] = '男'
# print(dict1)
# # 当字典中有对应键，赋值不同内容
# # 2.通过字典字，修改值，重新覆盖
# dict1['name'] = 'kunkun'
# print(dict1)
# # 3.删除键值对:使用del关键字，通过键删除：键值对
# # del dict1['like']
# # print(dict1)
# # 清空，使用clear方法
# # dict1.clear()
# # print(dict1)
# # del dict1
# # print(dict1) # NameError: name 'dict1' is not defined
# # 判断字典中是否有对应键：in  not in:仅仅只能判断字典中是否有对应的键，不能判断值
# print('like' in dict1)
# print('sex' in dict1)
# print('like2' not in dict1)
# print(28 in dict1)


# student = {"name": "tom", "name": "jerry"}  # key重复会出现后面的把前面的覆盖
# print(student)
# #
# student = {"name": "tom", "nickname": "tom"}  # value可以重复
# print(student)

dict1 = {'1': 2, 1: 1, 1.0: 2, '1.0': 3}

print(dict1['1'] + dict1[1] + dict1[1.0] + dict1['1.0'])

print(1 == 1.0)  # True
print('1' == '1.0')  # False
